ARG docker_repo=docker.wsl:8443
FROM ${docker_repo}/openjdk:21
ARG app_name
ENV APP_NAME=${app_name}
RUN groupadd -g 5000 -r comstar && \
    useradd -g 5000 -u 5013 cnp
USER cnp
WORKDIR /home/cnp
COPY --chown=cnp:comstar target/${app_name} ${app_name}
WORKDIR /home/cnp/${app_name}

CMD ["java", "-Dloader.path=lib ", "-jar", "lib/app.jar"]
